package 对象之封装.动物类;

public class text1 {
    public static void main(String[] args) {
        animal an = new animal();
        an.name = "小狗";
        an.age = 21;
        System.out.println(an.name);
        System.out.println(an.age);
        an.Features("小猫", 22);
        System.out.println("===========================");
        an.name = "小马";
        an.age = 25;
        System.out.println(an.name);
        System.out.println(an.age);
        an.Features("呀");
    }


}

class animal {
    String name;
    int age;

    public void Features(String a, int b) {
        System.out.println(name + "今年" + age + "岁了");
    }

    public void Features(String lei) {
        System.out.println("小鸟会飞" + lei);
    }
}
